#ifndef MUSIC_H
#define MUSIC_H

#include <QUrl>
#include <QImage>
#include <QVariant>
#include <QSqlDatabase>
#include <QSqlQuery>

class Music
{
public:
    Music();

    Music(QUrl url);

    void setMusicId(QString musicId);
    void setMusicName(const QString&);
    void setMusicSinger(const QString&);
    void setMusicAlbum(const QString&);
    void setMusicDuration(qint64);
    void setIsLike(bool);
    void setIsHistory(bool);
    void setMusicUrl(QUrl);
    void setDuration(int);
    void setMusicCover(QVariant);

    const QString& getMusicName() const;
    const QString& getMusicSinger() const;
    const QString& getMusicAlbum() const;
    qint64 getMusicDuration() const;
    bool getIsLike() const;
    bool getIsHistory() const;
    const QUrl& getMusicUrl() const;
    const QString& getMusicId() const;
    const QVariant& getMusicCover();
    QString getLrcFilePath();
    bool getIsSearched();
    void setIsSearched(bool);

    void writeMusicInfo();

private:
    void parse();

private:
    //音乐信息
    //UUID, universally unique identifier，32位数16进制数字
    QString musicId;
    QString musicName;
    QString musicSinger;
    QString musicAlbum;
    qint64 duration;
    bool isLike;
    bool isHistroy;
    QUrl musicUrl;
    QVariant musicCover;
    bool isSearched;
};


#endif // MUSIC_H
